package com.roy.netty.sworddemo;

import com.roy.netty.sworddemo.client.NettyTCPClient;
import com.roy.netty.sworddemo.client.PooledNettyTCPClient;

public class MyClinet2 {

	public static void main(String[] args) throws Throwable {
		String message = "test data";
		try{
			message = args[0];
		}catch(Exception e) {
			System.out.println("缺少参数");
		}
		//两种客户端模式
//		NettyTCPClient client = new SimpleNettyTCPClient();
		NettyTCPClient client = new PooledNettyTCPClient();
		try {
			String result = client.send(message);
			System.out.println("收到响应："+result);
		}catch(Exception e) {
			e.printStackTrace();
		}finally {
			client.close();
		}
		
	}
}
